<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:s="http://sduept.security.el/func"
	template="/template/template_dialog.xhtml">
	<ui:define name="head">
		<title>故障报告</title>
		<style>
.ui-widget {
font-family: "Microsoft JhengHei"; font-weight: bold; font-size: 1.15em;
}

.ui-commandlink {
font-family: FontAwesome;
}

.ui-panel .ui-panel-content {
border: 0; background: 0; padding: 0 !important;
}

.ui-panel .ui-panel-titlebar-icon {
margin-top: 0;
}

.ui-datatable .ui-datatable-footer {
text-align: right; padding: 4px 10px;
}

.ui-datatable .ui-datatable-header {
text-align: left; padding: 4px 16px;
/* border-top: 0px;
    border-left: 0px; */
}

.ui-datatable .ui-datatable-data {
border-top: 0px; border-left: 0px;
}

.ui-md-6,.ui-md-12,.ui-g-6,.ui-g-12 {
padding: 0px !important;
}

/* tr,tr td:first-child,tr th:first-child{
	border-left-width:0px !important;
} */
.box-tools i {
cursor: pointer; color: #999; margin-right: 5px;
}

.mouseon {
cursor: pointer;
}

.box-tools i:hover {
color: #3FA7DC;
}

.btn {
padding: 1px 6px;
}

td {
padding: 9px;
}

.ui-fileupload-icon-only .ui-button-text {
padding-bottom: .5em;
}
/**
* 分析详情里面的差动电流的title 居中
*/
.title-center .ui-datatable-header {
text-align: center;
}
</style>
		<link href='/resources/plugins/layer/skin/layer.css' rel='stylesheet' />
	</ui:define>
	<ui:define name="content">
		<p:dialog modal="true" widgetVar="uploadFile" draggable="false" height="150" width="800"
			closable="true" resizable="false" header="上传文件">
			<h:form id="form10">
				<p:fileUpload fileUploadListener="#{lineFaultDetailsController.handleFileUpload}"
					mode="advanced" dragDropSupport="false" update="form1:msg" uploadLabel="上传" cancelLabel="取消"
					label="选择" oncomplete="PF('uploadFile').hide()" allowTypes="/(\.|\/)(doc|docx|txt|xls|pdf)$/"
					invalidFileMessage="文件格式不支持" />
				<h:inputHidden id="actTimeList" value="#{lineFaultDetailsController.actTimeList}" />
			</h:form>
		</p:dialog>
		<div id="reportDiv" style="width: 100%; margin-left: auto; margin-right: auto;">
			<h:form id="actForm">
				<p:growl id="msgs" showDetail="true" />
				<p:panel header="动作分析" style="text-align: center;font-size:18px;">
					<f:facet name="actions">
						<p:commandButton rendered="#{lineFaultDetailsController.showBackButton}"
							style="float:left;font-size:16px;" icon="fa fa-chevron-circle-left" onclick="back();"
							value="返回"></p:commandButton>
						<p:commandButton style="float:left;font-size:16px;"
							rendered="#{s:hasPermission(session,'zym_bhrb_gzrb_bj')}"
							icon="ui-icon-pencil" value="编辑" update="actForm:msgs"
							actionListener="#{lineFaultDetailsController.checkEditPageAct(lineFaultDetailsController.record)}" />
						<p:commandButton id="imagePanelButton" style="float:right;font-size:16px;" type="button"
							rendered="#{lineFaultDetailsController.pmodel.firstSt != null &amp;&amp; lineFaultDetailsController.pmodel.secondSt != null}"
							onclick="openImagePanel();" value="报告附件" />
						<p:commandButton id="faultDetailButton" style="float:right;font-size:16px;" type="button"
							rendered="#{lineFaultDetailsController.pmodel.firstSt != null &amp;&amp; lineFaultDetailsController.pmodel.secondSt != null}"
							onclick="openTotalDetail();" value="故障详情" />
						<p:commandButton style="float:right;font-size:16px;" type="button"
							rendered="#{lineFaultDetailsController.pmodel.firstSt != null &amp;&amp; lineFaultDetailsController.pmodel.secondSt != null}"
							onclick="exchangeView();" value="动作列表" />
					</f:facet>
					<div class="ui-g" id="report" style="display: none">
						<p:outputPanel id="actList1"
							styleClass="#{lineFaultDetailsController.secondAction == null ? 'ui-g-12 ui-md-12' :'ui-g-6 ui-md-6'}"
							rendered="#{lineFaultDetailsController.firstAction != null}">
							<p:dataTable emptyMessage="无记录" value="#{lineFaultDetailsController.firstActList}" var="item">
								<f:facet name="header">
									<h:outputText value="#{lineFaultDetailsController.pmodel.firstSt.substationName}" />
								</f:facet>
								<p:column headerText="保护名称">
										#{item.name}
									</p:column>
								<p:column headerText="保护型号">
										#{item.dev_type}
									</p:column>
								<p:column headerText="动作时间">
									<h:outputText rendered="#{item.distance_0_moments_time gt 0}"
										value="#{item.distance_0_moments_time/1000}ms" />
									<h:outputText rendered="#{item.distance_0_moments_time le 0}" value="" />
								</p:column>
								<p:column headerText="动作情况">
									<h:outputText rendered="#{item.distance_0_moments_time gt 0}"
										value="#{item.jump_remark}#{item.phase}">
									</h:outputText>
									<h:outputText rendered="#{item.distance_0_moments_time le 0}" style="color:red"
										value="未检测到跳闸信号" />
								</p:column>
							</p:dataTable>
						</p:outputPanel>
						<p:outputPanel id="actList2" styleClass="ui-g-6 ui-md-6">
							<p:dataTable emptyMessage="无记录" rendered="#{lineFaultDetailsController.secondAction != null}"
								value="#{lineFaultDetailsController.secondActList}" var="item">
								<f:facet name="header">
									<h:outputText value="#{lineFaultDetailsController.pmodel.secondSt.substationName}" />
								</f:facet>
								<p:column headerText="保护名称">
										#{item.name}
									</p:column>
								<p:column headerText="保护型号">
										#{item.dev_type}
									</p:column>
								<p:column headerText="动作时间">
									<h:outputText rendered="#{item.distance_0_moments_time gt 0}"
										value="#{item.distance_0_moments_time/1000}ms" />
									<h:outputText rendered="#{item.distance_0_moments_time le 0}" value="" />
								</p:column>
								<p:column headerText="动作情况">
									<h:outputText rendered="#{item.distance_0_moments_time gt 0}"
										value="#{item.jump_remark}#{item.phase}">
									</h:outputText>
									<h:outputText rendered="#{item.distance_0_moments_time le 0}" style="color:red"
										value="未检测到跳闸信号" />
								</p:column>
							</p:dataTable>
						</p:outputPanel>
					</div>
					<div id="svgBox" class="onshow">
						<span id='span' style='font-size: 14px; display: none; padding: 0; margin: 0'>用来测字体宽高</span>
						<div class="tools" style="height: 40px; line-height: 40px">
							<div class="box-tools pull-right">
								<i class="glyphicon glyphicon-th-large" title="查看全部" id="seeAllInfo"></i> <i
									class="fa fa-refresh" aria-hidden="true" title="还原" id="refresh"></i> <i
									class="glyphicon glyphicon-download-alt" title="保存为图片" id="saveAsImage"> </i>
							</div>
						</div>
						<div id="actSvg" class="with-border">
							<svg id="svg"></svg>
						</div>
						<canvas id="canvas" style="display: none"></canvas>
					</div>
				</p:panel>
				<div id="imagePanelDiv" style="display: none">
					<p:panel id="imagePanel" header="保护动作报告附件" style="text-align: center;">
						<f:facet name="actions">
							<p:commandButton value="下载" ajax="false" style="float:right;font-size:16px;"
								rendered="#{s:hasPermission(session,'zym_bhrb_gzrb_fjxz')}"
								disabled="#{lineFaultDetailsController.attachmentList == null || lineFaultDetailsController.attachmentList.size() == 0}"
								actionListener="#{lineFaultDetailsController.downloadAttachment()}"
								icon="ui-icon-arrowthick-1-s" update="actForm:msgs">
								<p:fileDownload value="#{lineFaultDetailsController.file}" />
							</p:commandButton>
						</f:facet>
						<p:dataTable id="fat" var="componts" widgetVar="fat" rowIndexVar="ite"
							value="#{lineFaultDetailsController.attachmentList}" rowKey="#{componts.id}"
							emptyMessage="无记录">
							<p:column headerText="序号" width="10">
								<h:outputText value="#{ite+1}" />
							</p:column>
							<p:column headerText="名称" width="90">
								<h:outputText value="#{componts.name}" />
							</p:column>
							<p:column headerText="缩略图" width="18%">
								<p:graphicImage alt="加载失败" rendered="#{lineFaultDetailsController.isPicture(componts)}" height="100" value="#{request.contextPath}/getServerImage?fullPath=#{lineFaultDetailsController.getVirtualPath(componts.path)}"/> 
							</p:column>
							<p:column width="10" style="text-align: center">
					            <p:commandButton icon="ui-icon-search" rendered="#{lineFaultDetailsController.isPicture(componts)}" oncomplete="openImagePage('#{lineFaultDetailsController.getVirtualPath(componts.path)}');"/>
					        </p:column>
						</p:dataTable>
					</p:panel>
				</div>
			</h:form>
			<div id="faultDetailPanel" style="display: none">
				<h:form id="form1">
					<p:remoteCommand name="refreshController" oncomplete="refreshHtml()"
						actionListener="#{lineFaultDetailsController.init}"></p:remoteCommand>
					<p:remoteCommand name="refreshHtml" oncomplete="refreshSvg()"
						update=":form10:actTimeList actForm:actList1 actForm:imagePanel actForm:actList2 form1 firstSt secondSt"></p:remoteCommand>
					<p:growl id="msg" showDetail="true" sticky="true" />
					<p:panelGrid style="width:100% !important;">
						<f:facet name="header">
							<p:row>
								<p:column colspan="7">
									<p:remoteCommand name="updateFaultId" update="faultId"></p:remoteCommand>
									<h:inputHidden id="faultId" value="#{lineFaultDetailsController.faultId}" />
									<h:outputText value="线路故障分析报告" style="font-size:18px;" />
									<p:commandButton id="btn" style="float:right;" iconPos="right" icon="ui-icon-triangle-1-s"
										value="故障报告"></p:commandButton>
									<p:menu overlay="true" trigger="btn" at="bottom" my="top">
										<p:menuitem value="上传" icon="ui-icon-arrowreturnthick-1-n"
											onclick="PF('uploadFile').show();reinitDlgPosition();" />
										<p:menuitem value="下载" icon="ui-icon-arrowthick-1-s" update="form1:msg" ajax="false"
											actionListener="#{lineFaultDetailsController.downLoadReport()}">
											<p:fileDownload value="#{lineFaultDetailsController.reportfile}" />
										</p:menuitem>
										<p:menuitem value="重新生成" icon="ui-icon-refresh" update="form1:msg" ajax="false"
											actionListener="#{lineFaultDetailsController.refreshReport()}">>
											<p:fileDownload value="#{lineFaultDetailsController.reportfile}" />
										</p:menuitem>
									</p:menu>
								</p:column>
							</p:row>
						</f:facet>
						<p:row>
							<p:column colspan="2">
								<h:outputText value="故障设备：" />
							</p:column>
							<p:column>
								<h:outputText value="#{lineFaultDetailsController.pmodel.faultLineName}" style="color:blue;" />
							</p:column>
							<p:column>
								<h:outputText value="故障时间：" />
							</p:column>
							<p:column>
								<h:outputText style="color:blue;" value="#{lineFaultDetailsController.pmodel.faultTime}">
									<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
								</h:outputText>
							</p:column>
							<p:column>
								<h:outputText value="电压等级：" />
							</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.voltageLevel}kV" />
							</p:column>
						</p:row>
						<p:row>
							<p:column rowspan="2" colspan="2">
								<h:outputText value="故障原因分类：" />
							</p:column>
							<p:column rowspan="2" style="width:300px;">
								<h:outputText value="#{lineFaultDetailsController.pmodel.faultReason}" />
								<!-- <p:inputText style="float:left;" value="#{lineFaultDetailsController.pmodel.faultReason}" />
								<p:commandLink style="float:right;" styleClass="fa fa-question-circle-o"
									title="实际原因是根据巡线结果人工确认" />
								<p:commandButton style="float:left;margin-left:6px;" title="训练" icon="fa fa-cloud-upload "
									actionListener="#{lineFaultDetailsController.train()}" update="msg" /> -->
							</p:column>
							<p:column>
								<h:outputText value="故障原因：" />
							</p:column>
							<p:column style="width:300px;" colspan="1">
								<h:outputText escape="false" style="color:blue;"
									value="#{lineFaultDetailsController.replaceWithBr(lineFaultDetailsController.record.remark)}" />
							</p:column>
							<p:column>过渡电阻：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.faultResistance}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="智能分析：" />
							</p:column>
							<p:column style="width:300px;" colspan="1">
								<h:outputText escape="false" style="color:blue;white-space:pre-wrap;display:block;"
									value="#{lineFaultDetailsController.replaceWithBr(lineFaultDetailsController.record.thunderInfo)}" />
								<h:outputText escape="false" style="color:blue;white-space:pre-wrap;display:block;"
									value="#{lineFaultDetailsController.replaceWithBr(lineFaultDetailsController.record.iceInfo)}" />
							</p:column>
							<!-- <p:column>
								<h:outputText value="预测原因：" />
							</p:column>
							<p:column>
								<h:outputText style="color:blue;" value="#{lineFaultDetailsController.pmodel.faultForecastReason}" />
								<p:commandLink style="float:right;" styleClass="fa fa-question-circle-o"
									title="基于保护大数据的输电线路故障原因自动预测" />
								<p:commandButton style="float:right;" title="重新预测" icon="fa fa-refresh"
									actionListener="#{lineFaultDetailsController.forecast}" update="msg" />
							</p:column> -->
							<p:column>录波双端测距(km)</p:column>
							<p:column>
								<h:outputText style="color:blue;" value="#{lineFaultDetailsController.pmodel.doubleResult}"
									rendered="#{lineFaultDetailsController.pmodel.doubleResult gt 0}" />
								<h:outputText rendered="#{lineFaultDetailsController.pmodel.doubleResult==0}" value="">
								</h:outputText>
							</p:column>
						</p:row>
						<p:row>
							<p:column colspan="2">
								<h:outputText value="故障相别：" />
							</p:column>
							<p:column>
								<h:outputText style="color:blue;" value="#{lineFaultDetailsController.pmodel.phase}" />
							</p:column>
							<p:column>
								<h:outputText value="故障类型：" />
							</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.faultType==null?'未知':lineFaultDetailsController.pmodel.faultType}" />
							</p:column>
							<p:column>
								<h:outputText value="故障情况：" />
							</p:column>
							<p:column colspan="2">
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.faultCondition==null?'未知':lineFaultDetailsController.pmodel.faultCondition}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column colspan="2">
								<h:outputText value="初步分析结论：" />
							</p:column>
							<p:column colspan="5">
								<h:outputText value="#{lineFaultDetailsController.pmodel.conclusion}" style="color:blue;" />
								<p:commandLink value="分析详情  >>>"
									style="margin-left:40px;color: #3aa727;text-decoration: underline;" id="detail"
									onclick="openDetail()" />
							</p:column>
						</p:row>
					</p:panelGrid>
				</h:form>
				<h:form id="firstSt">
					<!-- <p:panelGrid columns="1" style="margin-top:5px;width:100% !important;"
						rendered="#{lineFaultDetailsController.pmodel.firstSt == null}">
						<f:facet name="header">
							<h:outputText style="float: left;font-size:15px;" value="#{lineFaultDetailsController.startStation}" />
						</f:facet>
						<h:outputText value="故障录波文件未上报" style="color:red;" />
					</p:panelGrid> -->
					<p:panelGrid style="margin-top:5px;width:100% !important;" id="firstGrid"
						rendered="#{lineFaultDetailsController.pmodel.firstSt != null}">
						<f:facet name="header">
							<p:row style="height:30px;line-height:30px;">
								<p:column colspan="8">
									<h:outputText style="float: left;font-size:15px;"
										value="#{lineFaultDetailsController.pmodel.firstSt.substationName}" />
									<p:commandButton id="btn" style="float:right" value="录波文件" icon="ui-icon-triangle-1-s"
										iconPos="right"></p:commandButton>
									<p:menu overlay="true" trigger="btn" my="top" at="bottom"
										model="#{lineFaultDetailsController.firstWaveListModel}">
									</p:menu>
									<p:commandButton id="file" actionListener="#{lineFaultDetailsController.downLoadFile('1')}"
										update="form1:msg" style="display:none;" ajax="false">
										<p:fileDownload value="#{lineFaultDetailsController.file}" />
									</p:commandButton>
								</p:column>
							</p:row>
						</f:facet>
						<p:row>
							<p:column>重合闸成功：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.firstSt.reclosingSuccess}" />
							</p:column>
							<p:column rowspan="2">故障持续时间：</p:column>
							<p:column>初次故障(ms)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.firstFault gt 0}"
									value="#{lineFaultDetailsController.pmodel.firstSt.firstFault/1000}">
									<f:convertNumber pattern="#0.0"></f:convertNumber>
								</h:outputText>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.firstFault le 0}" value="" />
							</p:column>
							<p:column rowspan="2">故障电流：</p:column>
							<p:column>二次值(A)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.firstSt.secondElectricity}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>录波情况：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.firstSt.waveRecordCondition}" />
							</p:column>
							<p:column>合于故障(ms)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.recloseFault gt 0}"
									value="#{lineFaultDetailsController.pmodel.firstSt.recloseFault/1000}">
									<f:convertNumber pattern="#0.0"></f:convertNumber>
								</h:outputText>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.recloseFault le 0}" value="" />
							</p:column>
							<p:column>一次值(kA)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.firstSt.firstElectricity}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column rowspan="3">故障测距：</p:column>
							<p:column>主一(km)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.faultRangingFirst gt 0}"
									value="#{lineFaultDetailsController.pmodel.firstSt.faultRangingFirst}">
								</h:outputText>
								<h:outputText rendered="#{lineFaultDetailsController.pmodel.firstSt.faultRangingFirst==0}"
									value="">
								</h:outputText>
							</p:column>
							<p:column rowspan="3">录波单端测距(km)：</p:column>
							<p:column rowspan="3">
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.rangingWave gt 0}"
									value="#{lineFaultDetailsController.pmodel.firstSt.rangingWave}">
								</h:outputText>
								<h:outputText rendered="#{lineFaultDetailsController.pmodel.firstSt.rangingWave==0}"
									value="">
								</h:outputText>
							</p:column>
							<p:column style="font-weight: bold;" rowspan="1">行波单端测距(km)：</p:column>
							<p:column rowspan="1" colspan="1">
								<h:outputText value="#{lineFaultDetailsController.pmodel.firstSt.travelingWave}" />
							</p:column>
							<p:column style="font-weight: bold;" rowspan="1">
								行波无双端测距原因简述：
							</p:column>
						</p:row>
						<p:row>
							<p:column>主二(km)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.faultRangingSecond gt 0}"
									value="#{lineFaultDetailsController.pmodel.firstSt.faultRangingSecond}">
								</h:outputText>
								<h:outputText rendered="#{lineFaultDetailsController.pmodel.firstSt.faultRangingSecond==0}"
									value="">
								</h:outputText>
							</p:column>
							<p:column style="font-weight: bold;" rowspan="1">行波双端测距(km)：</p:column>
							<p:column rowspan="1" colspan="1">
								<h:outputText value="#{lineFaultDetailsController.pmodel.firstSt.travelingWaveDouble}"
									inputStyle="width:99%;border:none" />
							</p:column>
							<p:column rowspan="2" colspan="1">
								<h:outputText escape="false"
									value="#{lineFaultDetailsController.pmodel.firstSt.travelingDoubleErrorReason }" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>主三(km)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.faultRangingThird gt 0}"
									value="#{lineFaultDetailsController.pmodel.firstSt.faultRangingThird}">
								</h:outputText>
								<h:outputText rendered="#{lineFaultDetailsController.pmodel.firstSt.faultRangingThird==0}"
									value="">
								</h:outputText>
							</p:column>
							<p:column style="font-weight: bold;" rowspan="1">行波测距装置型号：</p:column>
							<p:column rowspan="1" colspan="1">
								<h:outputText value="#{lineFaultDetailsController.pmodel.firstSt.travelingEquipmentType}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>快速保护是否动作：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.firstSt.rapidProtection}" />
							</p:column>
							<p:column>快速保护应评价次数：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.firstSt.rapidProtectionShould}" />
							</p:column>
							<p:column>实际快速动作次数：</p:column>
							<p:column colspan="3">
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.firstSt.protectRightActionCount != null and lineFaultDetailsController.pmodel.firstSt.protectRightActionCount > 0}"
									value="#{lineFaultDetailsController.pmodel.firstSt.rapidActionReality}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>初步分析结论： </p:column>
							<p:column colspan="7" style="color:blue;">
								<p:outputLabel
									rendered="#{lineFaultDetailsController.pmodel.firstSt.protectRightActionCount != null and lineFaultDetailsController.pmodel.firstSt.protectRightActionCount > 0}">
								保护正确动作
								#{lineFaultDetailsController.pmodel.firstSt.protectRightActionCount == null?0:lineFaultDetailsController.pmodel.firstSt.protectRightActionCount}
								次，误动	
								#{lineFaultDetailsController.pmodel.firstSt.protectUnwantedActionCount == null?0:lineFaultDetailsController.pmodel.firstSt.protectUnwantedActionCount}
								次，拒动
								#{lineFaultDetailsController.pmodel.firstSt.protectRefuseActionCount == null?0:lineFaultDetailsController.pmodel.firstSt.protectRefuseActionCount}
								次。</p:outputLabel>
							</p:column>
						</p:row>
					</p:panelGrid>
					<p:panel id="infoGrid2" style="border:0px;"
						rendered="#{lineFaultDetailsController.pmodel.firstSt != null}">
						<p:outputPanel>
							<p:dataTable emptyMessage="无动作信息" id="firstDatable" rowIndexVar="ite"
								value="#{lineFaultDetailsController.sumFirstActDetailList}" var="item">
								<p:column headerText="序号" style="width:60px;">
										#{ite+1}
									</p:column>
								<p:column headerText="保护名称">
										#{item.protectName}
									</p:column>
								<p:column headerText="保护类型">
										#{item.protectType}
									</p:column>
								<p:column headerText="保护型号">
										#{item.protectModel}
									</p:column>
								<p:column headerText="动作元件">
										#{item.actionComponent}
									</p:column>
								<p:column headerText="功能分类">
										#{item.funClassification}
									</p:column>
								<p:column headerText="动作时间（ms）">
										#{item.actionTime}
									</p:column>
								<p:column headerText="动作情况">
										#{item.actionCondition}
									</p:column>
								<p:column headerText="备注">
										#{item.remark}
									</p:column>
								<div style="text-align: right">
									<f:facet name="footer">
										<p:commandLink value="设置" title="设置动作元件"
											onclick="MyModal.showModal('/ui/config/dataConfig_dialog.xhtml',700,500,'保护动作设置')"
											style="margin-right:20px;" />
										<p:commandLink value="刷新" title="刷新动作元件" oncomplete="refreshSvg()"
											update="firstDatable firstSt:firstGrid secondSt:secondDatable secondSt:secondGrid :form10:actTimeList"
											actionListener="#{lineFaultDetailsController.reloadActionData()}" />
									</f:facet>
								</div>
							</p:dataTable>
						</p:outputPanel>
					</p:panel>
				</h:form>
				<h:form id="secondSt">
					<!-- <p:panelGrid columns="1" style="width:100% !important;margin-top:5px;"
					rendered="#{lineFaultDetailsController.pmodel.secondSt == null}">
					<f:facet name="header">
						<p:row style="padding:9px;">
							<p:column colspan="8">
								<h:outputText style="float: left;font-size:15px;" value="#{lineFaultDetailsController.endStation}" />
							</p:column>
						</p:row>
					</f:facet>
					<h:outputText value="故障录波文件未上报" style="color:red;" />
				</p:panelGrid> -->
					<p:panelGrid rendered="#{lineFaultDetailsController.pmodel.secondSt != null}" id="secondGrid"
						style="margin-top:5px;width:100% !important;">
						<f:facet name="header">
							<p:row style="height:30px;line-height:30px;">
								<p:column colspan="8">
									<h:outputText style="float: left;font-size:15px;"
										value="#{lineFaultDetailsController.pmodel.secondSt.substationName}" />
									<p:commandButton id="btn" style="float:right" value="录波文件" icon="ui-icon-triangle-1-s"
										iconPos="right"></p:commandButton>
									<p:menu overlay="true" trigger="btn" my="top" at="bottom"
										model="#{lineFaultDetailsController.secondWaveListModel}">
									</p:menu>
									<p:commandButton id="file" actionListener="#{lineFaultDetailsController.downLoadFile('2')}"
										update="form1:msg" style="display:none;" ajax="false">
										<p:fileDownload value="#{lineFaultDetailsController.file}" />
									</p:commandButton>
								</p:column>
							</p:row>
						</f:facet>
						<p:row>
							<p:column>重合闸成功：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.secondSt.reclosingSuccess}" />
							</p:column>
							<p:column rowspan="2">故障持续时间：</p:column>
							<p:column>初次故障(ms)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.secondSt.firstFault gt 0}"
									value="#{lineFaultDetailsController.pmodel.secondSt.firstFault/1000}">
									<f:convertNumber pattern="#0.0"></f:convertNumber>
								</h:outputText>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.secondSt.firstFault le 0}" value="" />
							</p:column>
							<p:column rowspan="2">故障电流：</p:column>
							<p:column>二次值(A)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.secondSt.secondElectricity}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>录波情况：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.secondSt.waveRecordCondition}" />
							</p:column>
							<p:column>合于故障(ms)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.secondSt.recloseFault gt 0}"
									value="#{lineFaultDetailsController.pmodel.secondSt.recloseFault/1000}">
									<f:convertNumber pattern="#0.0"></f:convertNumber>
								</h:outputText>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.secondSt.recloseFault le 0}" value="" />
							</p:column>
							<p:column>一次值(kA)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.secondSt.firstElectricity}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column rowspan="3">故障测距：</p:column>
							<p:column>主一(km)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.secondSt.faultRangingFirst gt 0}"
									value="#{lineFaultDetailsController.pmodel.secondSt.faultRangingFirst}">
								</h:outputText>
								<h:outputText
									rendered="#{lineFaultDetailsController.pmodel.secondSt.faultRangingFirst == 0}" value="">
								</h:outputText>
							</p:column>
							<p:column rowspan="3">录波单端测距(km)：</p:column>
							<p:column rowspan="3">
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.secondSt.rangingWave gt 0}"
									value="#{lineFaultDetailsController.pmodel.secondSt.rangingWave}">
								</h:outputText>
								<h:outputText rendered="#{lineFaultDetailsController.pmodel.secondSt.rangingWave == 0}"
									value="">
								</h:outputText>
							</p:column>
							<p:column style="font-weight: bold;" rowspan="1">行波单端测距(km)：</p:column>
							<p:column rowspan="1" colspan="1">
								<h:outputText value="#{lineFaultDetailsController.pmodel.secondSt.travelingWave}" />
							</p:column>
							<p:column style="font-weight: bold;" rowspan="1">
								行波无双端测距原因简述：
							</p:column>
						</p:row>
						<p:row>
							<p:column>主二(km)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.secondSt.faultRangingSecond gt 0}"
									value="#{lineFaultDetailsController.pmodel.secondSt.faultRangingSecond}">
								</h:outputText>
								<h:outputText
									rendered="#{lineFaultDetailsController.pmodel.secondSt.faultRangingSecond == 0}" value="">
								</h:outputText>
							</p:column>
							<p:column style="font-weight: bold;" rowspan="1">行波双端测距(km)：</p:column>
							<p:column rowspan="1" colspan="1">
								<h:outputText value="#{lineFaultDetailsController.pmodel.secondSt.travelingWaveDouble}"
									inputStyle="width:99%;border:none" />
							</p:column>
							<p:column rowspan="2" colspan="1">
								<h:outputText escape="false"
									value="#{lineFaultDetailsController.pmodel.secondSt.travelingDoubleErrorReason }" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>主三(km)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									rendered="#{lineFaultDetailsController.pmodel.secondSt.faultRangingThird gt 0}"
									value="#{lineFaultDetailsController.pmodel.secondSt.faultRangingThird}">
								</h:outputText>
								<h:outputText
									rendered="#{lineFaultDetailsController.pmodel.secondSt.faultRangingThird == 0}" value="">
								</h:outputText>
							</p:column>
							<p:column style="font-weight: bold;" rowspan="1">行波测距装置型号：</p:column>
							<p:column rowspan="1" colspan="1">
								<h:outputText value="#{lineFaultDetailsController.pmodel.secondSt.travelingEquipmentType}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>快速保护是否动作：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.secondSt.rapidProtection}" />
							</p:column>
							<p:column>快速保护应评价次数：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.secondSt.rapidProtectionShould}" />
							</p:column>
							<p:column>实际快速动作次数：</p:column>
							<p:column colspan="3">
								<h:outputText style="color:blue;"
									value="#{lineFaultDetailsController.pmodel.secondSt.rapidActionReality}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>初步分析结论： </p:column>
							<p:column colspan="7" style="color:blue;">
								<p:outputLabel
									rendered="#{lineFaultDetailsController.pmodel.secondSt.protectRightActionCount != null and lineFaultDetailsController.pmodel.secondSt.protectRightActionCount > 0}">
							保护正确动作
							#{lineFaultDetailsController.pmodel.secondSt.protectRightActionCount == null?0:lineFaultDetailsController.pmodel.secondSt.protectRightActionCount}
							次，误动	
							#{lineFaultDetailsController.pmodel.secondSt.protectUnwantedActionCount == null?0:lineFaultDetailsController.pmodel.secondSt.protectUnwantedActionCount}
							次，拒动
							#{lineFaultDetailsController.pmodel.secondSt.protectRefuseActionCount == null?0:lineFaultDetailsController.pmodel.secondSt.protectRefuseActionCount}
							次。</p:outputLabel>
							</p:column>
						</p:row>
					</p:panelGrid>
					<p:panel id="infoGrid4" style="border:0px !important;"
						rendered="#{lineFaultDetailsController.pmodel.secondSt != null}">
						<p:outputPanel rendered="#{lineFaultDetailsController.pmodel.secondSt != null}">
							<p:dataTable emptyMessage="无动作信息" id="secondDatable" rowIndexVar="ite"
								value="#{lineFaultDetailsController.sumSecondActDetailList}" var="item">
								<p:column headerText="序号" style="width:60px;">
									#{ite+1}
								</p:column>
								<p:column headerText="保护名称">
									#{item.protectName}
								</p:column>
								<p:column headerText="保护类型">
									#{item.protectType}
								</p:column>
								<p:column headerText="保护型号">
									#{item.protectModel}
								</p:column>
								<p:column headerText="动作元件">
									#{item.actionComponent}
								</p:column>
								<p:column headerText="功能分类">
									#{item.funClassification}
								</p:column>
								<p:column headerText="动作时间（ms）">
									#{item.actionTime}
								</p:column>
								<p:column headerText="动作情况">
									#{item.actionCondition}
								</p:column>
								<p:column headerText="备注">
									#{item.remark}
								</p:column>
								<div style="text-align: right">
									<f:facet name="footer">
										<p:commandLink value="设置" title="设置动作元件"
											onclick="MyModal.showModal('/ui/config/dataConfig_dialog.xhtml',700,500,'保护动作设置')"
											style="margin-right:20px;" />
										<p:commandLink value="刷新" title="刷新动作元件 " oncomplete="refreshSvg()"
											update="firstSt:firstDatable firstSt:firstGrid secondDatable secondSt:secondGrid :form10:actTimeList"
											actionListener="#{lineFaultDetailsController.reloadActionData()}" />
									</f:facet>
								</div>
							</p:dataTable>
						</p:outputPanel>
					</p:panel>
				</h:form>
			</div>
		</div>
		<div id="detailDiv"
			style="width: 100%; margin-left: auto; margin-right: auto; margin-top: 10px; display: none;">
			<ui:include src="/ui/map/protectActSvg/protectActDetail.xhtml"></ui:include>
		</div>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/plugins/snapsvg/snap.svg.js"></script>
		<script type="text/javascript" src="/ui/map/protectActSvg/svgFigure.js" />
		<script type="text/javascript" src="/ui/map/protectActSvg/canvg.js" />
		<script type="text/javascript" src="/ui/map/protectActSvg/actSvgData.js" />
		<script type="text/javascript" src="/ui/map/protectActSvg/drawActSvg.js" />
		<script type="text/javascript" src="/ui/map/protectActSvg/protectActSvg.js" />
		<script type="text/javascript" src="/resources/js/mymodal.js" />
		<script type="text/javascript" src="/resources/plugins/layer/layer.js" />
		<script>
			var lineId = "#{lineFaultDetailsController.pmodel.faultLineId}";
			var fault_time = $("#faultTime").val();
			//切换视图
			function exchangeView() {
				$("#report").toggle();
				$("#svgBox").toggle();
				if (iframe.length == 1) {
					parent.reinitIframe();
				}
				resizeHtml();
			}
			function openWaveDlg(fileId, stationId, stationName) {
				window.location.href = "/ui/waveh5/index.html?fileId=" + fileId
						+ "&amp;stationId=" + stationId + "&amp;lineId="
						+ lineId + "&amp;stationName="
						+ encodeURIComponent(stationName)+"&amp;showBackBtn=true";
			}
			function openHarDlg(fileId) {
				window.location.href = "/ui/wave/index.xhtml?fileId=" + fileId
				+ "&amp;lineId=" + lineId + "&amp;showBackBtn=true";
			}
			//详情
			function openDetail() {
				/* window.location.href ="protectActDetail.xhtml "?lineId="
						+ lineId + "&amp;faultTime=" + fault_time; */
				$("#detailDiv").show();
				$("#reportDiv").hide();
			}
			//故障详情
			function openTotalDetail() {
				var status = $("#faultDetailPanel").css("display");
				var btn = document.getElementById('actForm:faultDetailButton');
				if("none" == status ){
					$("#faultDetailPanel").show();
					$("html, body").animate({
					      scrollTop: $("#faultDetailPanel").offset().top }, {duration: 500,easing: "swing"});
				} else if("block" == status ){
					$("#faultDetailPanel").hide();
				}
			}
			//报告附件
			function openImagePanel() {
				var status = $("#imagePanelDiv").css("display");
				var btn = document.getElementById('actForm:imagePanelButton');
				if("none" == status ){
					$("#imagePanelDiv").show();
					$("html, body").animate({
					      scrollTop: $("#imagePanelDiv").offset().top }, {duration: 500,easing: "swing"});
				} else if("block" == status ){
					$("#imagePanelDiv").hide();
				} 
			}
			function backToReport() {
				$("#detailDiv").hide();
				$("#reportDiv").show();
			}
			function gotoFaultReportEdit() {
				updateFaultId();
				var fra = document.createElement("iframe");
				fra.style.background = 'transparent';
				fra.style.border = 0;
				fra.width = "100%";
				fra.id = "faultReportEditIframe";
				fra.height = document.documentElement.clientHeight -10 + "px";
				var faultId = document.getElementById('form1:faultId').value;
				var s = "/ui/dataview/devicefault/acLineFaultReport.xhtml?faultId=" + faultId + "&amp;showBackButton=true";
				fra.src = s;
				document.body.appendChild(fra);
				$('#reportDiv').hide();
				$(window).scrollTop(0);
			};
			function backFromFaultReportEdit(){
				document.body.removeChild(document.getElementById('faultReportEditIframe'));
				$('#reportDiv').show();
				refreshController();
			}
			//单个站的评价详情
			function openSingleDetail(stationId) {
				window.location.href = "singleProtectActDetail.xhtml?lineId="
						+ lineId + "&amp;faultTime=" + fault_time
						+ "&amp;stationId=" + stationId;
			}

			function reinitDlgPosition(){
				//重新渲染dlg位置
				var dlg=document.getElementById("j_idt11");
				$(dlg).css("top","50px");
			}
			function back(){
				if(parent.parent &amp;&amp; parent.parent.backFromFaultReport){
					parent.parent.backFromFaultReport();
				}else{
					window.history.back();
				}
			}
			function openImagePage(path){
				var link = document.createElement('a');
				link.target = "_blank";
				link.href = '/ui/common/imagePage.xhtml?fullPath='+path;
			    document.body.appendChild(link);
				link.click();
				document.body.removeChild(link);
			}
		</script>
	</ui:define>
</ui:composition>
